remotemanager.connection.computers.resource module

This module stores the placeholder arguments who’s job it is to convert arguments from the Dataset level mpi, omp, nodes, etc. to what the scheduler is expecting within a jobscript.

Note

Placeholders without a value are “falsy”. So checking their value in an if statement will return True if they have a value, False otherwise.

class remotemanager.connection.computers.resource.Resource(name: str, flag: str | None = None, tag: str | None = None, separator: str | None = None, **kwargs)[source]

Stub class to sit in place of an option within a computer.

Parameters:
  • name (str) – name under which this arg is stored

  • flag (str) – Flag to append value to e.g. –nodes, –walltime

  • separator (str) – Override the separator between flag and value (defaults to “=”)

  • tag (str) – Override the tag preceding the flag (defaults to “–“)

Note

For other args see the DynamicMixin class

property resource_line: str

Shortcut to output a suitable resource request line

Returns:

resource request line

Return type:

str

pack(collect_value: bool = True) dict[source]

Store this Resource in dict form

class remotemanager.connection.computers.resource.runargs(*args, **kwargs)[source]

Class to contain the dataset run_args in a way that won’t break any loops over the resources

Parameters:

args (dict) – Dataset run_args

property value

Prevents an AttributeError when a parser attempts to access the value.

Returns:

internal dict

Return type:

(dict)

property flag

Parsers should not access the flag method of the run_args, doing so likely means that a loop has iterated over this object and is attempting to insert it into a jobscript.

Converts an AttributeError to one more tailored to the situation.

Returns:

RuntimeError

class remotemanager.connection.computers.resource.Resources(resources, pragma, tag, separator, run_args)[source]

Container class to store Resource objects for use by a parser

get(name: str, default: any = '_unspecified')[source]

Allows resource.get(name)

items()[source]

dict.items() like proxy

property run_args: dict

Returns the stored run_args